<?php
/**********************************************************************//**\file
	Armory Guild  XML

	Description: Provides specific functions for parsing the wowarmory.com guild
		listing.
*******************************************************************************/

	class wowarmoryxml extends armoryxml
	{
		protected $guild;

		public function __construct()
		{
			$this->get_cache('guild', 'wowarmory');
			$this->guild = new wowarmorydata();
		}

		public function parse()
		{
			# PARSING
			$playerlist = $this->xmldata->getElementsByTagName('character');

			foreach ($playerlist as $player)
			{
				$name = utf8_decode($player->getAttribute('name'));
				$rank = $player->getAttribute('rank');
				$url = utf8_decode($player->getAttribute('url'));

				$this->guild->add_player($name, $rank, $url);
			}
		}

		public function store()
		{
			$this->guild->store();
		}

		public function debug()
		{
			$this->guild->debug();
		}

	}
?>
